# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=filecheck
pkgver=0.0.22
pkgrel=0
pkgdesc="Attempt to reimplement LLVM's FileCheck using Python"
url="https://github.com/mull-project/FileCheck.py"
arch="noarch"
license="Apache-2.0"
depends="python3"
makedepends="py3-poetry-core py3-build py3-installer"
checkdepends="py3-pytest"
source="https://github.com/mull-project/FileCheck.py/archive/v$pkgver/filecheck-$pkgver.tar.gz
	poetry-core.patch
	"
builddir="$srcdir/FileCheck.py-$pkgver"

build() {
	# poetry-core excludes files specified in .gitignore
	# fixed by setting GIT_DIR to somewhere that isn't a git repository
	GIT_DIR="$builddir" python3 -m build \
		--no-isolation \
		--wheel \
		--skip-dependency-check
}

check() {
	python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/filecheck-$pkgver-py3-none-any.whl
}

sha512sums="
f7d5385c396ef379376668ffd9359ad6203be2f56c807125e3c63e7664ccccff0045bc1c9fffe2c30e8cc91f028d6a386dbb19e4eaa5f3a35bb62bd98d278b90  filecheck-0.0.22.tar.gz
a673878a604201d6a8b664b1baabb7f10612bf446a6d93823847c220d9603f68c0d635ec7645d7ca45ed5f4ea2c7a38dc87fa247d4e646d809b47a00a4ce04bb  poetry-core.patch
"
